package com.yangrong.thread.chapter11;

public class QueryFromHttpAction {

//	public void execute(Context context) {
	public void execute() {
//		String name = context.getName();
		Context context = ActionContext.getActionContext().getContext();
//		String cardId = getCardId(name);
//		context.setCardId(cardId);
		String name = context.getName();
		String cardId = getCardId(name);
		context.setCardId(cardId);
	}

	private String getCardId(String name) {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return "1111111111" + Thread.currentThread().getName();
	}

}
